<form [formGroup]="registerFrom" (submit)="onSubmit()">
  <div>
    用户名：<input formControlName="username">
  </div>
  <div [hidden]="registerFrom.get('username').valid || registerFrom.get('username').untouched">
      <div [hidden]="!registerFrom.hasError('required','username')" >用户名是必填的</div>
      <div [hidden]="!registerFrom.hasError('minlength','username')">用户名的最小长度是6</div>
  </div>
  <div>
    手机号码：<input formControlName="telephone">
  </div>
  <div [hidden]="registerFrom.get('telephone').valid || registerFrom.get('telephone').pristine">
      <div [hidden]="!registerFrom.hasError('mobile','telephone')">电话号码格式错误</div>
  </div>
  <div formGroupName="passwordsGroup">
    <div>
      密码：<input formControlName="password">
    </div>
    <div [hidden]="!registerFrom.hasError('minlength',['passwordsGroup','password'])">密码长度至少为6</div>
    <div>
      确认密码：<input formControlName="repeatpassword">
    </div>
  </div>
  <!-- <div [hidden]="!registerFrom.hasError('password','passwordsGroup')">密码个确认密码不一致</div> -->
  <div [hidden]="!registerFrom.hasError('password','passwordsGroup')">111
    {{ registerFrom.getError('password','passwordsGroup')?.descxxx }}
  </div>
  <button type="submit">提交</button>
</form>
{{registerFrom.status}}